import java.util.Map;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import java.util.Map.Entry;

public class H {
    public static void main(String[] args) {
        // 实例化 HashMap  
        HashMap<Student, String> studentMap = new HashMap<>();

        Student s1 = new Student("A",1);//没问题
        studentMap.put(s1, "男");
        studentMap.put(new Student("Bob", 2), "女");
        studentMap.put(new Student("Charlie", 3), "男");

        // 遍历 HashMap  
        for (Map.Entry<Student, String> entry : studentMap.entrySet()) {
            Student student = entry.getKey();
            String grade = entry.getValue();
            System.out.println("Student: " + student + ", Grade: " + grade);
        }
    }
}